# 产生要给上班喜好的权重列表
from random import randint
import numpy as np

# 用于产生上班人员随机需求进行测试
# -1为不上，0为可上，1为AOC早班，2为AOC航后，3为AOC夜班
def RandomFun(m):
    # all_person = [
    #       {0: [1, 2, 3, 4, 5, 6, 7]},
	# 		{1: [1, 2, 3, 4, 5, 6, 7]},
	# 		{2: [1, 2, 3, 4, 5, 6, 7]},
	# 		{3: [1, 2, 3, 4, 5, 6, 7]},
	# 		{4: [1, 2, 3, 4, 5, 6, 7]},
	# 		{5: [1, 2, 3, 4, 5, 6, 7]},
	# 		{6: [1, 2, 3, 4, 5, 6, 7]},
	# 		{7: [1, 2, 3, 4, 5, 6, 7]},
	# 		{8: [1, 2, 3, 4, 5, 6, 7]},]
    a = 12
    n = 6
    assert a >= n >= 1

    all_person = []
    for i in range(m):
        #循环随机构造n个人的个人计划
        PersonDict = {}
        # 随机出一个人一周的计划，number(-1)<=3;number(1)+number(2)+number(3)<4;number(1),number(2),number(3)>=0
        PersonWeight = []
        for idx in range(n-1):
            PersonWeight.append(randint(1,a-sum(PersonWeight)-n+idx))
        PersonWeight.append(a-sum(PersonWeight))

        PersonDict[i] = PersonWeight
        all_person.append(PersonDict)
    return all_person